package util;

import entity.Feedback;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Date: 2020-04-22
 * @Description: @PACKAGE:util
 * @version: 1.0
 */
public class FeedBackRowMapper implements RowMapper<Feedback> {
    @Override
    public Feedback getRow(ResultSet resultSet) {
        Feedback feedback = new Feedback();
        //在结果集里拿数据，进行对象的赋值
        try {
            feedback.setNum(resultSet.getInt(1));
            feedback.setDoctorId(resultSet.getString(2));
            feedback.setDoctorName(resultSet.getString(3));
            feedback.setfMassage(resultSet.getString(4));
            feedback.setfDate(resultSet.getString(5));
            feedback.setFrequency(resultSet.getInt(6));
            feedback.setFlag(resultSet.getInt(7));

        } catch (SQLException e) {
            e.printStackTrace();
            System.out.println("未找到");
        }

        return feedback;
    }
}